import CommonHeader from '@/components/common-header/index'
import CommonInfo from '../components/CommonInfo/index'
import ApprovalButton from '../components/Button/index'
import SelectList from '../components/SelectList/index'
import Field from '../components/Field/index'
export default {
  name: 'ReimbursementApproval',
  components: {
    CommonHeader,
    CommonInfo,
    ApprovalButton,
    SelectList,
    Field,
  },
  data() {
    return {
      warn: '您有未填写的数据',
      approval: {
        acAmount: '',
        boAmount: '',
        files: '',
        reAmount: '',
        reimbursementType: '',
      },
      reimbursementTypeList: [
        '办公费用',
        '业务费用',
        '通讯费',
        '办公用品',
        '业务招待费',
        '福利费',
      ],
    }
  },
  methods: {
    getAcAmount(data) {
      this.approval.acAmount = data
    },
    getBoAmount(data) {
      this.approval.boAmount = data
    },
    getFiles(data) {
      this.approval.files = data
    },
    getReAmount(data) {
      this.approval.reAmount = data
    },
    getReimbursementType(data) {
      this.approval.reimbursementType = data
    },
  },
  watch: {
    approval: {
      deep: true,
      handler: function(newV, oldV) {
        for (let key in newV) {
          if (!newV[key]) {
            return
          }
        }
        this.warn = ''
      },
    },
  },
}
